<template>
  <el-input
    v-model="input"
    :disabled="disabled"
    :type="type"
    :readonly="readonly"
    @change="onChange"
    @input="onInput"
    placeholder="我是孙子组件的input"
    v-bind="$attrs"
    v-on="$listeners"
  ></el-input>
</template>

<script>
export default {
  data() {
    return {
      input: ''
    }
  },
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    type: {
      type: String,
      default: 'text'
    },
    readonly: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    onChange(v) {
      this.$emit('yeChange', v)
    },
    onInput(v) {
      this.$emit('yeInput', v)
    }
  }
}
</script>

<style></style>
